<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/limh/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/limh/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/limh/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/limh/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/limh/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/limh/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/limh/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="教程,">










<meta name="description" content="常量和符号常量在程序运行过程中，其值不能被改变的量称之为常量。常量分为不同的类型，有整型常量如 1、2、3、100；浮点型常量 3.14、0.56、-4.8；字符型常量„a‟、„b‟、„0‟；字符串常量“a”、“abc”、“1234”、“1234abcd”等。 细心的同学会发现，整型和浮点型常量我们直接写的数字，而字符型常量用单引号来表示一个字符，用双引号来表示一个字符串，尤其大家要注意„a‟和“">
<meta name="keywords" content="教程">
<meta property="og:type" content="article">
<meta property="og:title" content="12.5、C语言字符数组和字符指针">
<meta property="og:url" content="https://tdnr.gitee.io/limh/2014/12/01/mcu080/index.html">
<meta property="og:site_name" content="土逗牛肉">
<meta property="og:description" content="常量和符号常量在程序运行过程中，其值不能被改变的量称之为常量。常量分为不同的类型，有整型常量如 1、2、3、100；浮点型常量 3.14、0.56、-4.8；字符型常量„a‟、„b‟、„0‟；字符串常量“a”、“abc”、“1234”、“1234abcd”等。 细心的同学会发现，整型和浮点型常量我们直接写的数字，而字符型常量用单引号来表示一个字符，用双引号来表示一个字符串，尤其大家要注意„a‟和“">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2019-01-27T07:26:06.338Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="12.5、C语言字符数组和字符指针">
<meta name="twitter:description" content="常量和符号常量在程序运行过程中，其值不能被改变的量称之为常量。常量分为不同的类型，有整型常量如 1、2、3、100；浮点型常量 3.14、0.56、-4.8；字符型常量„a‟、„b‟、„0‟；字符串常量“a”、“abc”、“1234”、“1234abcd”等。 细心的同学会发现，整型和浮点型常量我们直接写的数字，而字符型常量用单引号来表示一个字符，用双引号来表示一个字符串，尤其大家要注意„a‟和“">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/limh/',
    scheme: 'Gemini',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://tdnr.gitee.io/limh/2014/12/01/mcu080/">





  <title>12.5、C语言字符数组和字符指针 | 土逗牛肉</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans ">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/limh/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">土逗牛肉</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/limh/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/limh/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/limh/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/limh/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br>
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/limh/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br>
            
            关于
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://tdnr.gitee.io/limh/limh/2014/12/01/mcu080/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="土逗牛肉">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/limh/images/avatar.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="土逗牛肉">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">12.5、C语言字符数组和字符指针</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2014-12-01T20:37:03+08:00">
                2014-12-01
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/limh/categories/单片机教程/" itemprop="url" rel="index">
                    <span itemprop="name">单片机教程</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="常量和符号常量"><a href="#常量和符号常量" class="headerlink" title="常量和符号常量"></a>常量和符号常量</h2><p>在程序运行过程中，其值不能被改变的量称之为常量。常量分为不同的类型，有整型常量如 1、2、3、100；浮点型常量 3.14、0.56、-4.8；字符型常量„a‟、„b‟、„0‟；字符串常量“a”、“abc”、“1234”、“1234abcd”等。</p>
<p>细心的同学会发现，整型和浮点型常量我们直接写的数字，而字符型常量用单引号来表示一个字符，用双引号来表示一个字符串，尤其大家要注意„a‟和“a”是不一样的，这个等会我们要详细介绍。</p>
<p>常量一般有两种表现形式：</p>
<ul>
<li>直接常量：直接以值的形式表示的常量称之为直接常量。上述举例这些都是直接常量，直接写出来了。</li>
<li>符号常量：用标识符命名的常量称之为符号常量，就是为上面的直接常量再取一个名字。使用符号常量一是方便理解，提高程序可读性，更重要的是方便程序的后续维护，习惯上符号常量我们都用大写字母和下划线来命名。</li>
</ul>
<p>比如，我们可以把 3.14 取名为 PI（即π）。再比如，我们上节课的串口程序，我们用的波特率是 9600，如果用符号常量来进行提前声明的话，那我们要修改成其它速率的话，就不用在程序中找 9600 修改了，直接修改声明处就可以了，两种方法举例说明。用 const 声明。比如我们在程序开始位置定义一个符号常量 BAUD。</p>
<p>定义形式是：</p>
<pre><code>const  类型  符号常量名字=常量值;
</code></pre><p>如<br>    const unsigned int BAUD = 9600;  /<em>注意结尾有个分号</em>/</p>
<p>我们就可以在程序中直接把 9600 改成 BAUD，这样我们如果要改波特率的话，直接在程序开头位置改一下这个值就可以了。用预处理命令#define 来完成，预处理命令我们先来认识#define。</p>
<p>定义形式是：</p>
<pre><code>#define  符号常量名  常量值
</code></pre><p>如</p>
<pre><code>#define  BAUD  9600  /*注意结尾没有分号*/
</code></pre><p>这样定义以后，只要在程序中出现 BAUD 的话，意思就是完全替代了后边的 9600 这个数字。</p>
<p>不知大家是否记得，我们之前定义数码管真值表的时候，用了一个 code 关键字。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">unsigned char code LedChar[] = &#123;  //数码管显示字符转换表</span><br><span class="line">    0xC0, 0xF9, 0xA4, 0xB0, 0x99, 0x92, 0x82, 0xF8,</span><br><span class="line">    0x80, 0x90, 0x88, 0x83, 0xC6, 0xA1, 0x86, 0x8E</span><br><span class="line">&#125;;</span><br></pre></td></tr></table></figure>
<p>我们当时说加了 code 之后，这个真值表的数据只能被使用，不能被改变，如果我们直接写 LedChar[0] = 1;这样就错了。实际上 code 这个关键字是 51 单片机特有的，如果是其它类型的单片机我们只需要写成 const unsigned char LedChar[]={}就可以了，自动保存到 FLASH里，而 51 单片机只用 const 而不加 code 的话，这个数组会保存到 RAM 中，而不会保存到FLAHS 中，鉴于此，在 51 这个体系下，const 反倒变得不那么重要了，它的作用被 code 取代了，这里大家知道这么回事即可。</p>
<p>我们来对各种类型的常量做进一步说明。</p>
<p>整型常量和浮点型常量就没多少可说的了，之前我们应用的都很熟练了，整型直接写数字就是十进制如 128，前边 0x 开头的表示是十六进制 0x80，浮点型直接写带小数点的数据就可以了。</p>
<p>字符型常量是由一对单引号括起来的单个字符。它分为两种形式，一种是普通字符，一种是转义字符。</p>
<p>普通字符就是那些我们可以直接书写直接看到的有形的字符，比如阿拉伯数字 0～9，英文字符 A～z，以及标点符号等。它们都是 ASCII 码表中的字符，而它们在单片机中都占用一个字节的空间，其值就是对应的 ASCII 码值。比如„a‟的值是 97，„A‟的值是 65，„0‟的值是48，如果定义一个变量 unsigned char a = „a‟，那么变量 a 的值就是 97。</p>
<p>除了上述这些字符之外，还有一些特殊字符，它们一些是无形的，像回车符、换行符这些都是看不到的，还有一些像‟\”这类字符它们已经有特殊用途了，想象一下如果写 ‘’’觉得编译器会怎么去解释呢。针对这些特殊符号，为了可以让它们正常进入到我们的程序代码中，C 语言就规定了转义字符，它是以反斜杠()开头的特定字符序列，让它们来表示这些特殊字符，比如我们用\n 来代表换行。我们用一个简单表格来说明一下常用的转义字符的意思，如表 12-2 所示。</p>
<p><strong>表 12-2 常用转义字符及含义</strong></p>
<table><tbody><tr><th>字符形式</th><th>含义</th></tr><tr><td>\n</td><td>换行</td></tr><tr><td>\t</td><td>横向跳格（相当于&nbsp;Tab）</td></tr><tr><td>\v</td><td>竖向跳格</td></tr><tr><td>\b</td><td>退格</td></tr><tr><td>\r</td><td>光标移到行首</td></tr><tr><td>\</td><td>反斜杠字符„\‟</td></tr><tr><td>\‟</td><td>单引号字符</td></tr><tr><td>\”</td><td>双引号字符</td></tr><tr><td>\f</td><td>走纸换页</td></tr><tr><td>\0</td><td>空值</td></tr></tbody></table>

<p>表格不需要大家记住，用到了，过来查就可以了。</p>
<p>字符串常量是用双引号括起来的字符序列，一般我们都称之字符串。如“a”、“1234”、“welcome to <a href="http://www.kingst.org”等都是字符串常量。字符串常量在内存中按顺序逐个存储字符串中的字符的" target="_blank" rel="noopener">www.kingst.org”等都是字符串常量。字符串常量在内存中按顺序逐个存储字符串中的字符的</a> ASCII 码值，并且特别注意，最后还有一个字符„\0‟，„\0‟字符的 ASCII 码值是 0，它是字符串结束标志，在写字符串的时候，这个„\0‟是隐藏的，我们看不到，但是实际却是存在的。所以“a”就比„a‟多了一个 „\0‟，“a”的就占了 2 个字节，而 „a‟只占一个字节。</p>
<p>还有一 个地 方要注 意， 就是字 符串 中的空 格， 也是一 个字 符，比 如 “welcome to <a href="http://www.kingst.org”一共占了" target="_blank" rel="noopener">www.kingst.org”一共占了</a> 26 个字节的空间。其中 21 个字母，2 个„.‟，2 个 „ ‟（空格字符）以及一个„\0‟。</p>
<h2 id="字符和字符串数组实例"><a href="#字符和字符串数组实例" class="headerlink" title="字符和字符串数组实例"></a>字符和字符串数组实例</h2><p>为了对比字符串、字符数组、常量数组的区别，我们写个了简单的演示程序，定义了 4个数组分别是：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">unsigned char array1[] = &quot;1-Hello!\r\n&quot;;</span><br><span class="line">unsigned char array2[] = &#123;&apos;2&apos;, &apos;-&apos;, &apos;H&apos;, &apos;e&apos;, &apos;l&apos;, &apos;l&apos;, &apos;o&apos;, &apos;!&apos;, &apos;\r&apos;, &apos;\n&apos;&#125;;</span><br><span class="line">unsigned char array3[] = &#123;51, 45, 72, 101, 108, 108, 111, 33, 13, 10&#125;;</span><br><span class="line">unsigned char array4[] = &quot;4-Hello!\r\n&quot;;</span><br></pre></td></tr></table></figure>
<p>在串口调试助手下，发送十六进制的 1、2、3、4，使用字符形式显示的话，会分别往电脑上送这 4 个数组中对应的那个数组。我们只是在起始位置做了区分，其它均没有区别。大家可以比较一下效果。</p>
<p>此外还要说明一点，数组 1 和数组 4，数组 1 我们是发完整的字符串，而数组 4 我们仅仅发送数组中的字符，没有发结束符号。串口调试助手用字符形式显示是没有区别的，但是大家如果改用十六进制显示，大家会发现数组 1 比数组 4 多了一个字节„ \0 ‟的 ASCII 值 00。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br></pre></td><td class="code"><pre><span class="line">#include &lt;reg52.h&gt;</span><br><span class="line">bit cmdArrived = 0; //命令到达标志，即接收到上位机下发的命令</span><br><span class="line">unsigned char cmdIndex = 0; //命令索引，即与上位机约定好的数组编号</span><br><span class="line">unsigned char cntTxd = 0; //串口发送计数器</span><br><span class="line">unsigned char *ptrTxd; //串口发送指针</span><br><span class="line">unsigned char array1[] = &quot;1-Hello!\r\n&quot;;</span><br><span class="line">unsigned char array2[] = &#123;&apos;2&apos;, &apos;-&apos;, &apos;H&apos;, &apos;e&apos;, &apos;l&apos;, &apos;l&apos;, &apos;o&apos;, &apos;!&apos;, &apos;\r&apos;, &apos;\n&apos;&#125;;</span><br><span class="line">unsigned char array3[] = &#123;51, 45, 72, 101, 108, 108, 111, 33, 13, 10&#125;;</span><br><span class="line">unsigned char array4[] = &quot;4-Hello!\r\n&quot;;</span><br><span class="line">void ConfigUART(unsigned int baud);</span><br><span class="line">void main()&#123;</span><br><span class="line">    EA = 1; //开总中断</span><br><span class="line">    ConfigUART(9600); //配置波特率为 9600</span><br><span class="line">   </span><br><span class="line">    while (1)&#123;</span><br><span class="line">        if (cmdArrived)&#123;</span><br><span class="line">            cmdArrived = 0;</span><br><span class="line">            switch (cmdIndex)&#123;</span><br><span class="line">                case 1:</span><br><span class="line">                    ptrTxd = array1; //数组 1 的首地址赋值给发送指针</span><br><span class="line">                    cntTxd = sizeof(array1); //数组 1 的长度赋值给发送计数器</span><br><span class="line">                    TI = 1; //手动方式启动发送中断，处理数据发送</span><br><span class="line">                    break;</span><br><span class="line">                case 2:</span><br><span class="line">                    ptrTxd = array2;</span><br><span class="line">                    cntTxd = sizeof(array2);</span><br><span class="line">                    TI = 1;</span><br><span class="line">                    break;</span><br><span class="line">                case 3:</span><br><span class="line">                    ptrTxd = array3;</span><br><span class="line">                    cntTxd = sizeof(array3);</span><br><span class="line">                    TI = 1;</span><br><span class="line">                    break;</span><br><span class="line">                case 4:</span><br><span class="line">                    ptrTxd = array4;</span><br><span class="line">                    cntTxd = sizeof(array4) - 1; //字符串实际长度为数组长度减 1</span><br><span class="line">                    TI = 1;</span><br><span class="line">                    break;</span><br><span class="line">                default:</span><br><span class="line">                    break;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br><span class="line">/* 串口配置函数，baud-通信波特率 */</span><br><span class="line">void ConfigUART(unsigned int baud)&#123;</span><br><span class="line">    SCON = 0x50; //配置串口为模式 1</span><br><span class="line">    TMOD &amp;= 0x0F; //清零 T1 的控制位</span><br><span class="line">    TMOD |= 0x20; //配置 T1 为模式 2</span><br><span class="line">    TH1 = 256 - (11059200/12/32)/baud; //计算 T1 重载值</span><br><span class="line">    TL1 = TH1; //初值等于重载值</span><br><span class="line">    ET1 = 0; //禁止 T1 中断</span><br><span class="line">    ES = 1; //使能串口中断</span><br><span class="line">    TR1 = 1; //启动 T1</span><br><span class="line">&#125;</span><br><span class="line">/* UART 中断服务函数 */</span><br><span class="line">void InterruptUART() interrupt 4&#123;</span><br><span class="line">    if (RI)&#123; //接收到字节</span><br><span class="line">        RI = 0; //清零接收中断标志位</span><br><span class="line">        cmdIndex = SBUF; //接收到的数据保存到命令索引中</span><br><span class="line">        cmdArrived = 1; //设置命令到达标志</span><br><span class="line">    &#125;</span><br><span class="line">    if (TI)&#123; //字节发送完毕</span><br><span class="line">        TI = 0; //清零发送中断标志位</span><br><span class="line">        if (cntTxd &gt; 0)&#123; //有待发送数据时，继续发送后续字节</span><br><span class="line">            SBUF = *ptrTxd; //发出指针指向的数据</span><br><span class="line">            cntTxd--; //发送计数器递减</span><br><span class="line">            ptrTxd++; //发送指针递增</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/limh/tags/教程/" rel="tag"># 教程</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/limh/2014/12/01/mcu079/" rel="next" title="12.4、C语言指向数组元素的指针">
                <i class="fa fa-chevron-left"></i> 12.4、C语言指向数组元素的指针
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/limh/2014/12/01/mcu081/" rel="prev" title="12.6、1602液晶介绍">
                12.6、1602液晶介绍 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  
    <div class="comments" id="comments">
      <div id="SOHUCS"></div>
    </div>

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="/limh/images/avatar.jpg" alt="土逗牛肉">
            
              <p class="site-author-name" itemprop="name">土逗牛肉</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/limh/archives/">
              
                  <span class="site-state-item-count">255</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/limh/categories/index.html">
                  <span class="site-state-item-count">8</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/limh/tags/index.html">
                  <span class="site-state-item-count">7</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/limhGeek" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="mailto:1591054297@qq.com" target="_blank" title="E-Mail">
                      
                        <i class="fa fa-fw fa-envelope"></i>E-Mail</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://www.jianshu.com/u/f73b243e7cc9" target="_blank" title="简书">
                      
                        <i class="fa fa-fw fa-user-circle-o"></i>简书</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#常量和符号常量"><span class="nav-number">1.</span> <span class="nav-text">常量和符号常量</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#字符和字符串数组实例"><span class="nav-number">2.</span> <span class="nav-text">字符和字符串数组实例</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">土逗牛肉</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Gemini</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
	var str = GetUrlParam('height');
    if (str === '0'){
		document.getElementById('header').style.display = 'none';
		document.getElementById('comments').style.display = 'none';
		document.getElementById('footer').style.display = 'none';
		document.getElementsByClassName('post-footer').item(0).style.display = 'none'
	}
	
    function GetUrlParam(paraName) {
        var url = document.location.toString();
        var arrObj = url.split("?");

        if (arrObj.length > 1) {
            var arrPara = arrObj[1].split("&");
            var arr;

            for (var i = 0; i < arrPara.length; i++) {
                 arr = arrPara[i].split("=");

                if (arr != null && arr[0] === paraName) {
                    return arr[1];
                }
            }
            return "";
        } else {
            return "";
        }
    }
</script>









  












  
  
    <script type="text/javascript" src="/limh/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/limh/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/limh/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/limh/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/limh/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/limh/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/limh/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/limh/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/limh/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
